package com.jumi.microservice.constant;

import com.jumi.microservice.common.exception.BusinessExceptionAssert;

/**
 * - - - - - - - - - - - - - - -
 *
 * @author liuz
 * @date 2020/7/18 17:35
 * ToDoSomeThing
 * - - - - - - - - - - - - - - -
 */
public enum ExceptionEnum implements BusinessExceptionAssert {

    /**
     * 返回状态码集
     */
    FAIL(500, "获取数据失败"),
    FAIL_CHANGE(500,"数据转换异常"),
    FAIL_NULL(500, "获取数据为空"),
    FAIL_ID_NULL(500, "数据id为空"),
    FAIL_RELATIONTRMP_NULL(500,"关联版式信息为空"),
    FAIL_UID_NULL(500,"检查请求头中用户ID是否存在"),
    FAIL_NAME_NULL(500,"检查请求头中用户名称是否存在"),
    FAIL_SOURCE_NULL(500,"素材信息为空"),
    FAIL_BRAND_NULL(500,"品牌信息为空"),
    FAIL_STATUS_SOURCE(500,"素材编码:[{}]为启用状态,不可删除"),
    FAIL_BRAND_SOURCE(500,"品牌编码:[{}]为启用状态,不可删除"),
    FAIL_BRAND_EXIST(500,"品牌名称已存在"),
    FAIL_FREIGHT_NULL(500,"运费模板信息为空"),
    FAIL_FREIGHT_DELETE(500,"运费模板信息为空"),
    FAIL_EXPRESS_NULL(500,"物流公司信息为空"),
    FAIL_EXPRESS_STATUS(500,"物流公司编码:[{}]为启用状态,不可删除"),
    FAIL_ALBLUM_NULL(500,"相册信息为空"),
    FAIL_IMAGE_NULL(500,"图片信息为空"),
    FAIL_SKU_SUPPLY(500,"商品库存信息为空"),
    FAIL_GOODS_EXIST(500,"商品spu信息为空"),
    FAIL_GOODS_SKU_EXIST(500,"商品sku信息为空"),
    FAIL_GOODS_CATEGORY_ID_NULL(500,"商品分类信息为空"),
    FAIL_RELATION_STATUS(500,"关联版式编码:[{}]为启用状态,不可删除"),
    FAIL_BRAND_BIND_GOODS(500,"品牌编码:[{}]已绑定到商品,不可删除"),
    FAIL_GOODS_SPU_MATERIA_EXIST(500,"商品spu物料信息为空"),
    FAIL_GOODS_SKU_MATERIA_EXIST(500,"商品spu物料信息为空"),
    FAIL_GOODS_FREIGHT_EXIST(500,"已有商品绑定该模板，不能删除"),
    FAIL_FREIGHT_BIG_LENGTH(500,"运费模板名称不能超过30位"),
    FAIL_GOODS_MATERIAL_RELATION_NULL(500,"商品sku的物料信息为空"),
    FAIL_FREIGHT_CONTINUE(500,"[{}]不能为0或者小于0"),
    FAIL_EXPRESS_EXIST(500,"物流公司名称已存在"),
    FAIL_STOCK_PRE_ZERO(500,"[{}]:添加数量与预售数量不能同时为0"),
    FAIL_ALL_STOCK_PRE_ZERO(500,"所有sku的添加数量与预售数量不能同时为0"),
    FAIL_BRAND_BIND_ACTIVITY(500,"品牌编码:[{}]已绑定到优品活动,不可删除"),
    ;

    private final Integer code;

    private final String message;

    ExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }}
